package com.idanchuang.project.basic.feign.client;

import com.idanchuang.component.base.JsonResult;
import com.idanchuang.project.basic.feign.dto.MessageDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * RPC接口样例
 *
 * @author yjy
 * @date 2020/5/14 12:57
 **/
// 不要在这里添加@RequestMapping注解, 否则会出现bean#method冲突的问题
@FeignClient(value = "project-basic") // 这里的value必须与 spring.application.name 配置相同, 否则无法找到相应的服务直连地址
public interface SampleFeignClient {

    @PostMapping("hello")
    JsonResult<String> hello(@RequestBody MessageDTO msg);

}
